#ifndef MATEMATICAS_H
#define MATEMATICAS_H

#include <math.h>
#include <limits>
#include <algorithm>

#define PI    3.14159265358979323846
#define dosPI (2 * PI)

#define EPSILON 0.000001

#define fequals(a,b) ( abs((a) - (b)) < EPSILON )
 
#define round(x) ( floor((x) + 0.5) )

#define DOUBLE_MAX ( std::numeric_limits<double>::max() )
#define DOUBLE_NAN ( std::numeric_limits<double>::signaling_NaN() )

#ifndef MIN
#define MIN(a,b) ( (a) < (b) ? (a) : (b) )
#endif

#ifndef MAX
#define MAX(a,b) ( (a) > (b) ? (a) : (b) )
#endif

#define esNan(x) ((x) != (x))

#endif